import Home from '../views/Home.vue'
import Login from '../views/Login.vue'
import Index from '../views/Index.vue'
export const routes = [
    {
        path: '/',
        redirect: '/login',
    },
    {
        path: '/login',
        component: Login,
    },
    {
        path: '/home',
        component: Home,
        redirect: '/index',
        children: [
            {
                path: '/index',
                component: Index,
                meta: { hidden: false },
            },
        ],
    },
    // 产品管理模块
    {
        path: '/home1',
        meta: { title: '电商模块' },
        component: Home,
        children: [
            {
                path: '/product/list',
                component: () =>
                    import('../views/plateform/product/list.vue'),
                meta: { hidden: true, title: '产品管理' },
            },
            {
                path: '/product/category',
                component: () =>
                    import('../views/plateform/product/category.vue'),
                meta: { hidden: true, title: '分类管理' },
            },
            {
                path: '/product/cart',
                component: () =>
                    import('../views/plateform/product/cart.vue'),
                meta: { hidden: true, title: '购物车管理' },
            },
            {
                path: '/product/banner',
                component: () =>
                    import('../views/plateform/product/banner.vue'),
                meta: { hidden: true, title: '轮播管理' },
            },
            {
                path: '/product/map',
                component: () =>
                    import('../views/plateform/product/map.vue'),
                meta: { hidden: true, title: '产品地图' },
            },
        ],
    },
    // 会员管理
    {
        path: '/home2',
        meta: { title: '会员管理' },
        component: Home,
        children: [
            {
                path: '/account/list',
                component: () =>
                    import('../views/plateform/account/list.vue'),
                meta: { hidden: true, title: '会员列表' },
            },
            {
                path: '/account/add',
                component: () =>
                    import('../views/plateform/account/add.vue'),
                meta: { hidden: true, title: '会员统计' },
            },
        ],
    },
    // oa管理
    {
        path: '/home4',
        meta: { title: 'OA管理' },
        component: Home,
        children: [
            {
                path: '/log/list',
                component: () => import('../views/plateform/log/list.vue'),
                meta: { hidden: true, title: '日志管理' },
            },
            {
                path: '/log/reply',
                component: () => import('../views/plateform/log/reply.vue'),
                meta: { hidden: true, title: '日志回复' },
            },
            {
                path: '/log/add',
                component: () => import('../views/plateform/log/add.vue'),
                meta: { hidden: true, title: '添加日志' },
            },
        ],
    },
    // 订单管理
    {
        path: '/home3',
        meta: { title: '订单管理' },
        component: Home,
        children: [
            {
                path: '/orders/list',
                component: () => import('../views/plateform/orders/list.vue'),
                meta: { hidden: true, title: '订单列表' },
            },
            {
                path: '/orders/statistics',
                component: () => import('../views/plateform/orders/statistics.vue'),
                meta: { hidden: true, title: '订单统计' },
            },
        ],
    },

    // 404路由不存在匹配，放在路由最下面
    {
        path: '/:pathMatch(.*)*',
        component: () => import('@/views/NotPage.vue'),
    },
]